{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1. 条件表达式"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入第一个整数：13\n",
      "请输入第二个整数：27\n",
      "使用条件表达式进行比较\n",
      "13小于27\n"
     ]
    }
   ],
   "source": [
    "# 从键盘录入两个整数，比较两个整数的大小\n",
    "num_a = int(input('请输入第一个整数：'))\n",
    "num_b = int(input('请输入第二个整数：'))\n",
    "# 比较大小\n",
    "'''\n",
    "if num_a >= num_b:\n",
    "    print(num_a, '大于等于', num_b)\n",
    "else:\n",
    "    print(num_a, '小于', num_b)\n",
    "'''\n",
    "print('使用条件表达式进行比较')\n",
    "# 左true 右false\n",
    "print(str(num_a) + '大于等于' + str(num_b) if num_a >= num_b else str(num_a) + '小于' + str(num_b))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.6.3",
   "language": "python",
   "name": "python3.6.3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
